#ifndef _GAME_LINIT_H
#define _GAME_LINIT_H

extern "C" {
#include "lua.h"
#include "lauxlib.h"
#include "lualib.h"

int luaopen_lfs(lua_State* L);
int luaopen_cjson(lua_State* L);
int luaopen_des56(lua_State* L);
int luaopen_md5_core(lua_State* L);
int luaopen_mime_core(lua_State* L);
int luaopen_socket_core(lua_State* L);
int luaopen_lanes_core(lua_State* L);
int luaopen_pb(lua_State* L);
int luaopen_pb_io(lua_State* L);
int luaopen_pb_conv(lua_State* L);
int luaopen_pb_buffer(lua_State* L);
int luaopen_pb_slice(lua_State* L);
int luaopen_pb_unsafe(lua_State* L);
int luaopen_luasql_mysql(lua_State* L);
int luaopen_spdlog(lua_State* L);
int luaopen_luv(lua_State* L);
}

/*
** these libs are loaded by lua.c and are readily available to any Lua
** program
*/
static const luaL_Reg loadedlibs[] = {
  {"_G", luaopen_base},
  {LUA_LOADLIBNAME, luaopen_package},
  {LUA_COLIBNAME, luaopen_coroutine},
  {LUA_TABLIBNAME, luaopen_table},
  {LUA_IOLIBNAME, luaopen_io},
  {LUA_OSLIBNAME, luaopen_os},
  {LUA_STRLIBNAME, luaopen_string},
  {LUA_MATHLIBNAME, luaopen_math},
  {LUA_UTF8LIBNAME, luaopen_utf8},
  {LUA_DBLIBNAME, luaopen_debug},
#if defined(LUA_COMPAT_BITLIB)
  {LUA_BITLIBNAME, luaopen_bit32},
#endif
  {NULL, NULL}
};

void luaL_openlibs(lua_State* L);
void luaL_preloadf(lua_State* L, const char* modname, lua_CFunction luaopen_modname);

#endif // !_GAME_LINIT_H
